/**
* Appcelerator Titanium Platform
* Copyright (c) 2009-2011 by Appcelerator, Inc. All Rights Reserved.
* Licensed under the 
* terms of the Apache Public License
* Please see the LICENSE included with this distribution for details.
**/
// Code is stripped-down version of Tweetanium, to expose new structure paradigm

(function() {	
	
	//Globally available theme object to hold theme colors/constants
	S.ui.theme = {
		textColor:'#000000',
		grayTextColor:'#888888',
		headerColor:'#333333',
		lightBlue:'#195ba3',
		darkBlue:'#073269',
		fontFamily: S.os({
			iphone:'Helvetica Neue',
			android:'Droid Sans'
		})
	};
	
	// Layout specific properties
	S.ui.layout = {
		tabCount: (Ti.Platform.displayCaps.platformWidth >= 480) ? 4 : 3,
		tabSize: Math.round(Ti.Platform.displayCaps.platformWidth/4),
		tableRowHeight: 90
	};

	//All shared property sets are declared here.
	S.ui.properties = {
		//grab platform dimensions only once to save a trip over the bridge
		platformWidth: Ti.Platform.displayCaps.platformWidth,
		platformHeight: Ti.Platform.displayCaps.platformHeight,
		animationDuration: 300,
		//we use these for default components
		mainWindow: {
			orientationModes:[Ti.UI.PORTRAIT],
    		fullscreen:true,  
    		navBarHidden:true,
    		exitOnClose:true	
		},
		Button: {
			height:50,
			width:250,
			color:'#000',
			font: {
				fontSize:18,
				fontWeight:'bold'
			}
		},
		Label: {
			color:S.ui.theme.textColor,
			font: {
				fontFamily:S.ui.theme.fontFamily,
				fontSize:15
			},
			textAlign: "center",
			height:'auto'
		},
		TextField: {
			height:55,
			borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED,
			color:'#000000',
			clearButtonMode: Titanium.UI.INPUT_BUTTONMODE_ALWAYS
		},
		headerView: {
			top:0,
			backgroundColor:'#c3155c',
			height:S.ui.layout.tabSize/2,
			//backgroundImage:'header_bg.png',
			zIndex:2
			
		},
		headerLabel: {
			font: {
				fontFamily:'Lacu_i',
				fontSize: '14dp'
			}
		},
		topPadding: {
			layout: 'vertical',
			height:S.ui.layout.tabSize*2/3
		},
		bottomPadding: {
			layout: 'vertical',
			height:S.ui.layout.tabSize*6/5
		},		
		mainFilmStrip: {
			//top:S.ui.layout.tabSize/2,
			//height:Ti.Platform.displayCaps.platformHeight-S.ui.layout.tabSize/2
			height:Ti.Platform.displayCaps.platformHeight
		},		
		contentView: {
			layout: 'vertical',
			backgroundColor:'#f8f5eb',
			width: Ti.Platform.displayCaps.platformWidth,
			//backgroundImage:'KS_nav_ui.png',
			zIndex:1,
			font: {
				fontFamily: S.os({
					iphone:'Helvetica Neue',
					android:'Lacu_r'
				})
			}
		},
		
		
		
		
		
		
		
		/* Tab navigation */
		tabView: {
			//contentWidth:1500,
			contentHeight: S.ui.layout.tabSize,
			bottom: 0,
			height: S.ui.layout.tabSize,
			backgroundColor: S.ui.theme.lightBlue,
			zIndex: 2
		},
		tabItem: {
			left: 0,
			top: 0,
			bottom: 0,
			height: S.ui.layout.tabSize,
			width: S.ui.layout.tabSize,
			backgroundColor: S.ui.theme.darkBlue,
			borderColor: S.ui.theme.darkBlue,
			borderWidth: 1
		},
		
		
		
		/* Loading Indicator */
		
		loadingIndicator: {
			top: Ti.Platform.displayCaps.platformHeight/2-S.ui.layout.tabSize,
			left: Ti.Platform.displayCaps.platformWidth/2-S.ui.layout.tabSize/2,
			width: S.ui.layout.tabSize,
			height: S.ui.layout.tabSize,
			visible: false
		},
		loadingIndicatorImg: {
			width: S.ui.layout.tabSize,
			height: S.ui.layout.tabSize,
			images: [
				'/images/activityIndicator/frm02.png',
				'/images/activityIndicator/frm02.png',
				'/images/activityIndicator/frm03.png',
				'/images/activityIndicator/frm04.png',
				'/images/activityIndicator/frm05.png',
				'/images/activityIndicator/frm06.png',
				'/images/activityIndicator/frm07.png',
				'/images/activityIndicator/frm08.png',
				'/images/activityIndicator/frm09.png',
				'/images/activityIndicator/frm10.png',
				'/images/activityIndicator/frm11.png',
				'/images/activityIndicator/frm12.png',
				'/images/activityIndicator/frm13.png',
				'/images/activityIndicator/frm14.png',
				'/images/activityIndicator/frm15.png'
			],
			duration: 100,
			repeatCount: 99
			
		},
		/* About */
		aboutHeaderLabel: {
			width: Ti.Platform.displayCaps.platformWidth,
			color:S.ui.theme.darkBlue,
			font: {
				fontFamily:'Lacu_i',
				fontSize: '18dp'
			},
			textAlign: "center"
		},
		aboutContentLabel: {
			color:S.ui.theme.darkBlue,
			font: {
				fontFamily:'Lacu_r',
				fontSize: '15dp'
			},
			width:'86%'
		},
		
		
		
		
		
		
		
		
		/* News */
		newsSliderWindow: {
			orientationModes: [Ti.UI.PORTRAIT],
    		fullscreen: true,  
    		navBarHidden: true,
    		exitOnClose: true
		},
		shareBar: {
			top: 0,
			backgroundColor: '#c3155c',
			height: S.ui.layout.tabSize/2 + S.ui.layout.tabSize/13,
			//backgroundImage:'header_bg.png',
			zIndex: 2			
		},
		sliderCloseButton: {
			width: S.ui.layout.tabSize/2,
			height: S.ui.layout.tabSize/2,
			top: 0,
			right: 0,
			backgroundColor: '#fff'
			
		},
		shareBarLabel: {
			font: {
				fontFamily:'Lacu_i',
				fontSize: '14dp'
			}		
		},
		newsSliderFooter: {
			bottom: S.ui.layout.tabSize*(-1),
			height: S.ui.layout.tabSize
		},
		newsPageIndicator: {
			bottom: 0,
			width: Ti.Platform.displayCaps.platformWidth,
			height: S.ui.layout.tabSize/13,
			backgroundColor: S.ui.theme.darkBlue,
			zIndex: 3
		},
		paginationDivider: {
			width: 1,
			backgroundColor: S.ui.theme.lightBlue 
		},
		currentPageIndicator: {
			height: S.ui.layout.tabSize/13,
			backgroundColor: S.ui.theme.lightBlue
		},
		thumbnailView: {
			height:S.ui.layout.tabSize,
			width:S.ui.layout.tabSize,
			backgroundColor: S.ui.theme.lightBlue
		},
		newsTableRow: {
			height:S.ui.layout.tabSize,
			width: 'auto',
			//backgroundColor: '#678987',
		    
		    width:'86%'
		},
		newsTableRowBorderTop: {
			layout: 'vertical',
		    top: 0,
		    height: 1,
		    backgroundColor: '#ccc'			
		},
		newsTableRowBorderBottom: {
			layout: 'vertical',
			top: 0,
		    height: 1,
		    backgroundColor: S.ui.theme.darkBlue
		},
		newsRowTitle: {
			color: S.ui.theme.darkBlue,
			top: 5,
			left: S.ui.layout.tabSize - 10,
			font: {
				fontWeight: 'bold',
				fontSize: '15dp'
			}
		},
		newsRowImage: {
			height: S.ui.layout.tabSize - 20,
			width: S.ui.layout.tabSize - 20,
			left: 0,
			top: 10
		},
		newsRowCreated: {
			color: S.ui.theme.lightBlue,
			bottom: 5,
			right: 0,
			font: {
				fontSize: '10dp'
			}
		},
		newsArticleSlider: {
			height: Ti.Platform.displayCaps.platformHeight,
			top: 0,
			backgroundColor:'#f8f5eb'
			
		},
		newsStoryPage: {
			scrollType: 'vertical',
			top: 0,
			bottom: 0,
			width: Ti.Platform.displayCaps.platformWidth,
			contentWidth: Ti.Platform.displayCaps.platformWidth
		},
		newsStoryInnerContainer: {
			width: '86%',
			layout: 'vertical'		
			
		},
		newsStoryImage: {
			width: '100%',
			layout: 'vertical'
		},
		newsStoryBody: {
			layout: 'vertical',
			color: S.ui.theme.darkBlue,
			font: {
				fontFamily: 'Lacu_r',
				fontSize: '15dp'
			},
			width: '100%'			
		},
		newsStoryTitle: {
			layout: 'vertical',
			color: S.ui.theme.lightBlue,
			font: {
				fontFamily: 'Lacu_r',
				fontSize: '17dp',
				fontWeight: 'bold'
			},
			width: '100%'	
		}
		
		
		
		
		
		
		
		
		
		
		
		
		
		
	};
})();

//global shortcut for UI properties, since these get used A LOT. polluting the global
//namespace, but for a good cause (saving keystrokes)
var $$ = S.ui.properties;
